/**
 *
 * author ThuanLT
 * Aug 22, 2014
 *
 */

package vn.fsoft.gst.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import vn.fsoft.gst.domain.Address;
import vn.fsoft.gst.service.AddressService;

@Repository
@Controller
public class AddressController {

	@Autowired
	
	private AddressService addressService;

	/**
	 * get list Address in database to user lookup when add Organisation,...
	 * @param model
	 * @return lookupAddress view
	 */
	@RequestMapping(value = "/lookupAddress", method = RequestMethod.GET)
	public String addOrgGet(ModelMap model) {
		List<Address> listAddress = addressService.getListAdress();
		model.addAttribute("listAddress", listAddress);
		return "lookupAddress";
	}
}
